package com.gnote.repair.service.impl;


import com.gnote.repair.domain.EmsReportConfig;
import com.gnote.repair.mapper.ReportConfigMapper;
import com.gnote.repair.service.EmsReportConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lijingwei
 * &#064;description  针对表【EMS_REPORT_CONFIG】的数据库操作Service实现
 * &#064;createDate  2025-07-29 14:41:14
 */
@Service
public class EmsReportConfigServiceImpl implements EmsReportConfigService {

    @Autowired
    private ReportConfigMapper reportConfigMapper;

    @Override
    public List<EmsReportConfig> getReportConfigList(EmsReportConfig emsReportConfig) {
        return reportConfigMapper.selectList(emsReportConfig);
    }

    @Override
    public String saveReportConfig(EmsReportConfig emsReportConfig) {
        int i = reportConfigMapper.insertSelective(emsReportConfig);
        if (i<=0){
            return "保存失败";
        }
        return "保存成功";
    }

    @Override
    public String deleteReportConfig(String id) {
        int i = reportConfigMapper.deleteByPrimaryKey(id);
        if (i<=0){
            return "删除失败";
        }
        return "删除成功";
    }

    @Override
    public String updateReportConfig(EmsReportConfig emsReportConfig) {
        int i = reportConfigMapper.updateByPrimaryKeySelective(emsReportConfig);
        if (i<=0){
            return "更新失败";
        }
        return "更新成功";
    }
}
